package com.gongren.project.job.pay;

import com.alibaba.dubbo.config.annotation.Reference;
import com.gongren.project.pay.rpc.api.taskRpc.IOverduePayTaskRpcService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author houzhong
 * @Date 2017/9/1 13:12
 */
@Component("overduePayTask")
public class OverduePayTask {

    private static Logger Logger = LoggerFactory.getLogger(OverduePayTask.class);

    @Reference
    private IOverduePayTaskRpcService overduePayTaskRpcService;

    /**
     * 每天2点
     * @author mwz
     * @since  2017年6月12日 上午9:45:16
     */
    //@Scheduled(cron = "0 0 2 * * ?")
    public void handleTask() {
        Logger.info("OverduePayTask adn handleTask start");
        try {
            overduePayTaskRpcService.findAllHandleTask();

            Logger.info("OverduePayTask and handleTask end");
        } catch (Exception e){
            Logger.error("OverduePayTask and handleTask："+e);
        }
    }
}
